<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:useBean id="productBean" class="by.grsu.bso.beans.ProductUtilBean" scope="application" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<div class="layout-middle">
   <div class="sidebar">
    <strong class="sidebar-header">Книги</strong>
    <ul>
     <li><a href="?products=1">Пользователи</a></li>
     <li><a href="?products=2">Товары</a></li>
     <li><a href="?products=3">Заказы</a></li>
    </ul>
   </div>
   <div class="content">

    <h2 align="center" style="margin: 4px 2px">Все книги</h2>
    <c:set var="currentProduct" value="${applicationScope.productBean.getAllProducts()}" />
	<c:if test="${param.products==2}">
	
		<table border="1px">
		<tr>
		<td>ID</td>
		<td>Название</td>
		<td>Автор</td>
		<td>Цена</td>
		<td>Год издания</td>
		</tr>
		<c:forEach items="${currentProduct}" var="itemProduct">
		<tr>
		<td>${itemProduct.id}</td>
		<td>${itemProduct.name}</td>
		<td>${itemProduct.autor}</td>
		<td>${itemProduct.price}</td>
		<td>${itemProduct.yearPublication}</td>
		</tr>
		
		</c:forEach>
		</table>
	</c:if>
  </div>

  </div>